package com.exam.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.exam.dao.StuLoginMapper;
import com.exam.pojo.Admin;
import com.exam.service.StuLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StuLoginServiceImpl implements StuLoginService {

    @Autowired
    private StuLoginMapper loginMapper;

    @Override
    public Admin getLogin(Admin admin) {
        QueryWrapper<Admin> queryWrapper = new QueryWrapper<>(admin);
        queryWrapper.eq("Name",admin.getName());
        queryWrapper.eq("sex",admin.getSex());
        queryWrapper.eq("tel",admin.getTel());
        queryWrapper.eq("email",admin.getEmail());
        queryWrapper.eq("pwd",admin.getPwd());
        queryWrapper.eq("Card",admin.getCard());
        queryWrapper.eq("role",admin.getRole());
        return loginMapper.selectOne(queryWrapper);
    }
}
